CC EMI API INTEGRATION.
Overview
This document explains how to integrate the Pine Labs edge payment gateway in seamless mode.
Implementation Details
Below apis need to be integrated:
Accept Payment:
It initiates the transaction. Merchant must pass unique merchant txn reference number, amount, and other parameters.
URL:
UAT https://uat.pinepg.in/api/v2/accept/payment Production https://pinepg.in/api/v2/accept/payment
Request Headers:
HEADERS:
Header name | Header value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256of (Base64 request encoded payload) |
Body Param
Parameter Name | Type | Description | Mandatory(M)/Optional |
---|---|---|---|
merchant_data | Object | It contains information about merchant. | M |
payment_data | Object | It contains information about payment data. | M |
txn_data | Object | It contains transaction related data | M |
customer_data | Object | It contains information about customer data.Merchants who are on aggregator model must pass this data | O |
udf_data | Object | It contains user defined fields. Merchant can pass it transaction specific data in these fields | O |
merchant_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
merchant_id | int | Merchant id provided by pinelabs | M |
merchant_access_code | string | Merchant access code provided by pine labs | M |
unique_merchant_txn_id | string | Unique transaction id maintained by merchant for each transaction | M |
merchant_return_url | string | Merchant return url on which browser response will be sent.Mandatory in the case of EMI | M |
payment_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
amount_in_paisa | long | Transaction amount in paise | M |
txn_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
navigation_mode | Int | Navigation mode 2 for Redirect7 for Seamless | M |
payment_mode | String | It will contain csv of valid payment mode Ids.In case of seamless mode only single payment mode to be specified. | M |
transaction_type | Int | 1 for ‘Purchase’ | M |
time_stamp | Long | Unix timestamp | O |
customer_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
email_id | string | Customer email id | O |
first_name | string | Customer first name | O |
last_name | string | Customer last name | O |
customer_id | string | Customer id maintained at merchant end | O |
mobile_no | string | 10 digit mobile number | O |
billing_data | Object | Customer billing address details | O |
shipping_data | Object | Customer Shipping address details | O |
udf_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
udf_field_1 | string | User defined Fields | O |
udf_field_2 | string | User defined Fields | O |
udf_field_3 | string | User defined Fields | O |
udf_field_4 | string | User defined Fields | O |
udf_field_5 | string | User defined Fields | O |
billing_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
address1 | string | Address 1 | O |
address2 | string | Address 2 | O |
address3 | string | Address 3 | O |
pincode | string | Pin code | O |
city | string | City name | O |
state | string | State name | O |
country | string | Country name | O |
shipping_data
Parameter Name | Type | Description | Mandatory(M)/Optional/Conditional |
---|---|---|---|
first_name | String | First name entered in shipping address | O |
last_name | String | Last name entered in shipping address | O |
mobile_no | string | Mobile number entered in shipping address | O |
address1 | string | Address 1 | O |
address2 | string | Address 2 | O |
address3 | string | Address 3 | O |
pincode | string | Pin code | O |
city | string | City name | O |
state | string | State name | O |
country | string | Country name | O |
Sample Request
Json Payload
{
"merchant_data": {
"merchant_id": 3473,
"merchant_access_code": "57e39383-b053-4db9-a708-26d8971886e7",
"unique_merchant_txn_id": "testorder786",
"merchant_return_url": "http://localhost:53132/ChargingResp.aspx"
},
"payment_data": {
"amount_in_paisa": 1100000
},
"txn_data": {
"navigation_mode": "7",
"payment_mode": "4",
"transaction_type": "1",
"time_stamp": 157588000000
}
}
BASE 64 encoded request:
{
"request": "ewogICJtZXJjaGFudF9kYXRhIjogewogICAgIm1lcmNoYW50X2lkIjogMzQ3MywKICAgICJtZXJjaGFudF9hY2Nlc3NfY29kZSI6ICI1N2UzOTM4My1iMDUzLTRkYjktYTcwOC0yNmQ4OTcxODg2ZTciLAogICAgInVuaXF1ZV9tZXJjaGFudF90eG5faWQiOiAidGVzdG9yZGVyNzg2IiwKICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly9sb2NhbGhvc3Q6NTMxMzIvQ2hhcmdpbmdSZXNwLmFzcHgigi-CiAgfSwKICAicGF5bWVudF9kYXRhIjogewogICAgImFtb3VudF9pbl9wYWlzYSI6IDExMDAwMDAKICB9LAogICJ0eG5fZGF0YSI6IHsKICAgICJuYXZpZ2F0aW9uX21vZGUiOiAiNyIsCiAgICAicGF5bWVudF9tb2RlIjogIjQiLAogICAgInRyYW5zYWN0aW9uX3R5cGUiOiAiMSIsCiAgICAidGltZV9zdGFtcCI6IDE1NzU4ODAwMDAwMAogIH0KfQo="
}
Response
Params
Parameter Name | Type | Description |
---|---|---|
response_code | int | It notifies the result of api processing. Value 1 denotes success. |
response_message | string | It denotes the message corresponding to above code |
token | string | It is the token created for a transaction. You need to pass it in the subsequent calls. |
redirect_url | String | Redirect url on which customer needs to be redirected. This parameter will be present only in redirect mode. |
Sample Response
Redirect mode
{
"token": "ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4%3d",
"response_code": 1,
"response_message": "SUCCESS",
"redirect_url": "http://hostname:port/api/v2/process/payment?token=ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4% 3d"
}
In redirect mode api will return a url on which customer needs to be redirected. Pine Labs payment page will get open after redirection. On CardlessEMI the same redirect mode api will return a url on which customer needs to be redirected to the payment page you need to enter mobile number for the eligibility check to load the relevant Issuers.
Seamless mode
{
"token": "S01ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4%3d",
"response_code": 1,
"response_message": "SUCCESS"
}
In seamless mode api will not a redirect url and subsequent api needs to be called.
Failure response
{
"response_code": -1,
"response_message": "FAILURE"
}
Process Payment
Payment data against transaction will be passed in this call. This api will be called in seamless mode.
For Cardless transactions data against will be passed in this same call as well.
Token received in previous call needs to be part of this call.
http://hostname:port/api/v2/process/payment?token= ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4%3d "
Request
UAT https://uat.pinepg.in/api/v2/process/payment?token=BJ5Dj5o 5dh6jZaWCTAv%2fnwJj0h%2f3Eiq2HgY14%2fMOP7k%3d Production https://pinepg.in/api/v2/process/payment?token=BJ5Dj5o5dh 6jZaWCTAv%2fnwJj0h%2f3Eiq2HgY14%2fMOP7k%3d
Body Params
Parameter Name | Type | Description Mandatory/Optional/Conditional |
---|---|---|
card_data | Object | It contains card data.It is mandatory for cards and EMI transaction |
emi_data | Object | It contains EMI data.Mandatory for EMI |
netbanking_data | Object | It contains net banking codes.Mandatory for net banking transaction |
wallet_data | Object | It contains wallet information.Mandatory for wallet transaction |
additional_data | Object | Reserved for Future Use |
cardless_data | Object | It contains cardless emi information.Mandatory for cardless emi transaction |
card_data
Parameter Name | Type | Description Mandatory/Optional/Conditional |
---|---|---|
card_number | String | Card number |
card_expiry_year | String | Card expiry year having format YYYY |
card_expiry_month | String | Card expiry month having format MM |
card_holder_name | String | Card holder name |
cvv | String | Card CVV |
additional_data
Parameter Name | Type | Description |
---|---|---|
mobile_number | string | 10 digit mobile number |
emi_data
Parameter Name | Type | Description |
---|---|---|
offer_scheme | Object | It contains information about offer applicable on each product. |
tenure_id | Int | Tenure Id specified at pine labs end. |
tenure_in_month | String | Tenure name specified at pine labs end. |
monthly_installment | Long | Emi amount in paise. |
bank_interest_rate | Long | Interest rate for which bank emi is calculated. Its value is percentage multiplied by 10000. |
interest_pay_to_bank | Long | Interest pay to bank in paise. |
total_offerred_discount_cashback_amount | Long | Total sum of discount applicable on cart. It is in paise. |
loan_amount | Long | Amount in paise on which loan will be booked. |
auth_amount | Long | Bank authorization amount in paise. |
offer_scheme
Parameter Name | Type | Description |
---|---|---|
product_details | Array of objects | It contains information about product. |
emi_scheme | Object | It contains information about bank EMI scheme. |
product_details
Parameter Name | Type | Description |
---|---|---|
product_code | String | Product code. |
product_amount | Long | Product amount in paise. |
subvention_cashback_discount | Long | Subvention discount cashback amount in paise. Only applicable when subvention is present. |
product_discount | Long | Product discount amount in paise. Only applicable if product discount is present. |
subvention_cashback_discount_percentage | Long | Subvention discount cashback percentage. Its value is percentage multiplied by 10000. |
product_discount_percentage | Long | Product discount cashback percentage. Its value is percentage multiplied by 10000. |
subvention_type | Int | It tells offer type. 1-No cost EMI 2-Low cost EMI 3-Standard EMI. |
additional_cashback | String | Additional cashback text. |
bank_interest_rate | Long | Amount in paise. |
bank_interest_rate_percentage | Long | Percentage multiplied by 10000. |
schemes | Array of objects | It contains list of program applicable on product. |
emi_scheme
Parameter Name | Type | Description |
---|---|---|
scheme_id | Long | It tells scheme id applicable on product. |
program_type | Int | It tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount. |
is_scheme_valid | Bool | Is scheme is valid. |
schemes
Parameter Name | Type | Description |
---|---|---|
scheme_id | Long | It tells scheme id applicable on product. |
program_type | Int | It tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount. |
is_scheme_valid | Bool | Is scheme is valid. |
cardless_data
Parameter Name | Type | Mandatory/Optional/Conditional |
---|---|---|
issuername | String | Issuer Name |
tenure | Int | Loan Month tenure details |
country_code | String | Customer Mobile Code |
mobile_number | String | Customer Mobile Number |
Sample request
EMI Sample Request
{
"card_data": {
"card_number": "4012007141112",
"card_expiry_year": "2020",
"card_expiry_month": "09",
"card_holder_name": "harsh",
"cvv": "123"
},
"emi_data": {
"offer_scheme": {
"product_details": [
{
"schemes": [
{
"scheme_id": 1682,
"program_type": 112,
"is_scheme_valid": true
}
],
"product_code": "SM-G975FCWG",
"product_amount": 550000,
"subvention_cashback_discount": 60209,
"product_discount": 0,
"subvention_cashback_discount_percentage": 0,
"product_discount_percentage": 0,
"subvention_type": 1
},
{
"schemes": [],
"product_code": "40",
"product_amount": 550000,
"subvention_cashback_discount": 0,
"product_discount": 0,
"subvention_cashback_discount_percentage": 0,
"product_discount_percentage": 0
}
],
"emi_scheme": {
"scheme_id": 1683,
"program_type": 105,
"is_scheme_valid": true
}
},
"tenure_id": "18",
"tenure_in_month": "18",
"monthly_installment": 64867,
"bank_interest_rate": 150000,
"interest_pay_to_bank": 127815,
"total_offerred_discount_cashback_amount": 60209,
"loan_amount": 1039791,
"auth_amount": 1039791
}
}
Card Sample Request
{
"card_data": {
"card_number": "4012001037141112",
"card_expiry_year": "2019",
"card_expiry_month": "12",
"card_holder_name": "harsh",
"cvv": "123"
}
}
Sample Card Details for Testing:
Card Number: 4012001037141112
Expiry: 11/27
Name: TEST
CVV : 123
Cardless Emi
{
"cardless_data": {
"issuer": {
"name": "AXIO/SBI"
},
"tenure": 12,
"customer": {
"phone": {
"country_code": "091",
"mobile_number": "9578036789"
}
}
}
}
Response
Params
Parameter Name | Type | Description |
---|---|---|
response_code | int | It notifies the result of api processing. Value 1 denotes success. |
response_message | string | It denotes the message corresponding to above code |
redirect_url | String | Customer should be redirected to below url. |
api_url | String | Api url on which you need to make subsequent request |
offer_scheme | Object | It contains information about offer applicable on each product |
offer_scheme
Parameter Name | Type | Description |
---|---|---|
product_details | Array of objects | It contains information about product. |
emi_scheme | Object | It contains information about bank EMI scheme. |
product_details
Parameter Name | Type | Description |
---|---|---|
product_code | String | Product code. |
product_amount | Long | Product amount in paise. |
subvention_cashback_discount | Long | Subvention discount cashback amount in paise. Only applicable when subvention is present. |
product_discount | Long | Product discount amount in paise. Only applicable if product discount is present. |
subvention_cashback_discount_percentage | Long | Subvention discount cashback percentage. Its value is percentage multiplied by 10000. |
product_discount_percentage | Long | Product discount cashback percentage. Its value is percentage multiplied by 10000. |
subvention_type | Int | It tells offer type. 1-No cost EMI 2-Low cost EMI 3-Standard EMI. |
additional_cashback | String | Additional cashback text. |
bank_interest_rate | Long | Amount in paise. |
bank_interest_rate_percentage | Long | Percentage multiplied by 10000. |
schemes | Array of objects | It contains list of program applicable on product. |
emi_scheme
Parameter Name | Type | Description |
---|---|---|
scheme_id | Long | It tells scheme id applicable on product. |
program_type | Int | It tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount. |
is_scheme_valid | Bool | Is scheme is valid. |
schemes
Parameter Name | Type | Description |
---|---|---|
scheme_id | Long | It tells scheme id applicable on product. |
program_type | Int | It tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount. |
is_scheme_valid | Bool | Is scheme is valid. |
reasons | Array of object | Description for failure of schemes |
Reasons
Parameter Name | Type | Description |
---|---|---|
reason_code | int | It denotes the reason code |
reason_message | String | It denotes the reason message again the code |
Sample Response
Successful response for Cards, EMI, CardlessEMI for process payment api
{
"response_code": 1,
"response_message": "SUCCESS",
"redirect_url": "http://hostname:port/pinepg/v2/process/payment?token=848RFsu%2bRnNcSsaZdzEgkeosvCc2o5lK TV4uKJF%2fcjE%3d"
}
Payment Modes
PAYMENT_MODE_ID | PAYMENT_MODE_NAME |
---|---|
1 | CREDIT/DEBIT CARD |
4 | EMI |
14 | DEBIT EMI |
19 | CARDLESS EMI |
Transaction Status
TXN_STATUS_ID | TXN_STATUS_NAME | DESCRIPTION |
---|---|---|
-10 | Cancelled | when the user cancels the transaction. |
-8 | Velocity Check Failed | Velocity check failed for EMI transactions |
-7 | Failure Transaction has failed due to some reasons e.g. bank session time out, insufficient funds. Payer needs to re-initiate the transaction. | |
-6 | Rejected | Transaction has been rejected. |
1 | Initiated | Pine Labs payment gateway has not received response from Payment Provider/Bank. For all such transactions, We will retry the transaction, post which the transaction status will be updated to ‘Captured‘ or‘AuthReceived’ or ‘Rejected’. |
4 | Captured | 'Captured' call is successful. Funds will be transferred to merchant account. |
6 | Refunded | Refund of the transaction is successful. |
7 | Query Complete | Query of the transaction is successful captured |
9 | Partially Refunded | Transaction is partially refuned |
10 | Refund Initiated | When refund of aggregator transaction is initiated |
CARDLESS INFORMATION DATA:
AXIO Data:
Test Mobile number for AXIO system:
9999412233,9999412234,9999412235,9999412236,9999412237,9999412238,9999412239, 9999412240,9999412241,9999412242
Test Data OTP = 123456
PAN =XYZPA1234A (For Ekyc)
DOB = 21-07-1980
Aadhaar = 9999 9999 1234
Aadhaar OTP = 123456
UPI ID - Any valid upi id like ‘nametest@ybl’
SBI Data:
username: -sbipre03 Password: -a1234567. Mobile no:-(need to map)
username: -sbipre04 Password: -a1234567. mobile no:-(need to map)
username: -sbitek03 Password: -a1234567. mobile no: -9578036789